// 引入axios（axios进行二次封装）
import request from '@/utils/request'

// 获取品牌列表接口
export const reqTradeMarkList = (page, limit) => request({
    url: `/admin/product/baseTrademark/${page}/${limit}`,
    method: 'GET'
});

// 处理添加或更新品牌
export const reqAddOrUpdateTradeMark = (tradeMark) => { 
    if (tradeMark.id) {
        // 修改品牌
        return request({
            url: '/admin/product/baseTradeMark/update',
            method: "POST",
            data: tradeMark
        })
    } else { 
        // 新增品牌
        return request({
            url: '/admin/product/baseTradeMark/save',
            method: "POST",
            data:tradeMark
        })
    }
}

// 处理删除品牌
export const reqDeleteTradeMark = (id) => request({
    url: `/admin/product/baseTrademark/remove/${id}`,
    method: 'DELETE',
})